﻿@using NFine.Domain._03_Entity.Weixin
@{
    ViewBag.Title = "我要提现";
    Layout = "~/Areas/WeiXinAreas/Views/Shared/_LayoutWeui.cshtml";
}
<style>
    .weui-cells {
        margin-top: .5rem;
    }

    .weui-btn {
        border-radius: 0;
    }
</style>
<div class="weui-cells" style="background-color:#35a4fe;">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <div style="padding-left:1rem; padding-right:1rem;">
                <div style="width:50%; float:left; margin-top:.5rem;">
                    <div style="font-size:.7rem; color:#fff;">帐户余额：</div>
                    <div style="color:#fdcb07; font-size:1rem;">¥@ViewData["haveWith"]</div>
                </div>
                <div style="width:50%; float:left; margin-top:.5rem;">
                    <div style="font-size:.7rem; color:#fff;">可提现金额：</div>
                    <div style="color:#fdcb07; font-size:1rem;">¥@ViewData["canWith"]</div>
                </div>
                <div style="clear:both;"></div>
                <div style="font-size:.6rem;margin-top:.5rem; color:#eee;">注：满十元可提现。提现收取1.5%的手续费</div>
            </div>
        </div>
    </div>
</div>
<div class="weui-cells">
    <a class="weui-cell weui-cell_access" href="~/WeiXinAreas/Main/TXPost">
        <div class="weui-cell__hd"><img src="~/Content/M/img/gn_withdrawal.png" style="width:1.5rem" /></div>
        <div class="weui-cell__bd">
            提现记录
        </div>
        <div class="weui-cell__ft">
        </div>
    </a>
</div>
@{
    var list = (List<NFine.Domain._03_Entity.Biz.UserWithdrawalsEntity>)ViewData["list"];
    if (list != null && list.Count > 0)
    {
        <div class="weui-cells">
            @foreach (var with in list)
                {
                <div class="weui-cell">
                    <div class="weui-cell__bd">
                        <div style="padding-left:1rem; padding-right:1rem;">
                            <div style="width:50%; float:left;">
                                <div style="color:#fdcb07; height:1.3rem; font-size:0.8rem;">¥@with.F_WithdrawalsMoney </div>
                                <div style="font-size:.7rem; color:#666;">@with.F_WithdrawalsTime</div>
                            </div>
                            <div style="width:50%; float:left;">
                                <div style="color:#FF0000; height:1.3rem; font-size:.7rem; text-align:right;">等待处理</div>
                            </div>
                        </div>
                    </div>
                </div>
            }
        </div>
    }
}
@if (ViewData["canWith"].ToString()!="0.00")
{
    <form id="form1">
        <div class="weui-cells__title">提现信息</div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                @{
                    var card = (NFine.Domain._03_Entity.Biz.UserBankEntity)ViewData["card"];
                }
                <div class="weui-cell__hd"><label for="" class="weui-label">卡&nbsp;&nbsp;&nbsp;&nbsp;号</label></div>
                <div class="weui-cell__bd">
                    <input type="hidden" value="@Html.Raw(card != null ? card.F_Id : "0")" name="F_Id" id="F_Id" />
                    <input class="weui-input" readonly @*pattern="[0-9]*"*@ value="@Html.Raw(card != null ? card.F_Account : "")" placeholder="请选择银行卡" id="F_Account" name="F_Account">
                </div>
                <div class="weui-cell__ft">
                    <a onclick="location.replace('Account')">  <img src="~/Content/M/img/choose.png" /></a>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">银&nbsp;&nbsp;&nbsp;&nbsp;行</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly value="@Html.Raw(card != null ? card.F_BankName : "")" id="F_BankName" name="F_BankName">
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">姓&nbsp;&nbsp;&nbsp;&nbsp;名</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly value="@Html.Raw(card != null ? card.F_AccountName : "")" id="F_AccountName" name="F_AccountName">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">金&nbsp;&nbsp;&nbsp;&nbsp;额</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input digits" type="number" placeholder="请输入提现金额"  id="F_Money" name="F_Money">
                </div>
                @*<div class="weui-cell__ft">
                    <i class="weui-icon-success"></i>
                </div>*@
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">备&nbsp;&nbsp;&nbsp;&nbsp;注</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" value="" placeholder="有什么需要提醒的" name="F_Remark" id="F_Remark">
                </div>
            </div>
        </div>
        <a href="javascript:submit();" class="weui-btn weui-btn_primary" style="margin-top:.5rem;background-color:#35a4fe;">提交申请<i class="weui-loading" style="display:none;"></i></a>
    </form>
                    }
<div style="height:60px;"></div>
<div class="weui-tabbar" style="position:fixed;">
    <a href="~/WeiXinAreas/Main/Index" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/home@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">首页</p>
    </a>
    <a href="~/WeiXinAreas/Main/NewsList" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/kecheng@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">新闻</p>
    </a>
    <a href="~/WeiXinAreas/Main/Ponser" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/person@2x_.png" alt="">
        </div>
        <p class="weui-tabbar__label">个人</p>
    </a>
</div>
@section footScript
{
    <script type="text/javascript">

        function setInvalid(str) {
            var a = str;
            $.alert(str);
        }
        function submit() {
            if (yan() != false) {
                $(".weui-loading").show();
                $.ajax({
                    url: "/MemberManage/MemberWithdrawals/Withdrawals",
                    data: { money: $("#F_Money").val(), bankId: $("#F_Id").val() },
                    dataType: 'json',
                    type: 'post',
                    success: function (_data) {
                       // $.alert(_data);
                        location.replace("TX");
                    }
                });
            }
        }
        function yan() {
            if ($("#F_AccountId").val() == 0) {
                $.alert("请选择银行卡!");
                return false;
            }
            if ($("#F_Money").val() == '') {
                $.alert("请输入提现金额!");
                return false;
            }
            if($("#F_Money").val()<10){
                $.alert("提现金额不能少于10元!");
                return false;
            }
            if(@ViewData["canWith"]<$("#F_Money").val()){
                $.alert("可提现金额为"+@ViewData["canWith"]+"元!");
                return false;
            }
            return true;
        }
    </script>
}
